﻿using Furion.DatabaseAccessor;
using System;
using System.ComponentModel.DataAnnotations;

namespace Pear.Core
{
    /// <summary>
    /// 文章内容（博客）
    /// </summary>
    public class Article : Entity<int>
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public Article()
        {
            CreatedTime = DateTime.Now;
            IsDeleted = false;
        }

        /// <summary>
        /// 文章名称
        /// </summary>
        [Required, MaxLength(32)]
        public string Title { get; set; }

        /// <summary>
        /// 文章封面
        /// </summary>
        [MaxLength(256)]
        public string Cover { get; set; }

        /// <summary>
        /// 分类ID
        /// </summary>
        [Required]
        public int ArticleId { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        [Required, MaxLength(32)]
        public string ArticleTypeName { get; set; }

        /// <summary>
        /// 文章状态（具体信息看枚举）
        /// </summary>
        [Required]
        public ArticleStatus ArticleStatus { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        [Required, MaxLength(3000)]
        public string Content { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime ReleaseTime { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; } = 0;

        /// <summary>
        /// 是否热门
        /// </summary>
        public bool IsHot { get; set; } = false;

        /// <summary>
        /// 浏览量
        /// </summary>
        public int PageView { get; set; } = 0;

        /// <summary>
        /// 点赞数
        /// </summary>
        public int GiveALikeCount { get; set; } = 0;
    }
}